package org.jxc.service;
 
import org.hibernate.SessionFactory;
import org.jxc.dao.ProductionOrderDAO;
import org.jxc.domain.ProductionOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.team4.dao.DAOFactory;
import org.team4.exception.CRUDException;
import org.team4.service.IService;
import org.team4.vo.Page;

public class ProductionOrderService implements IService {

	private ProductionOrderDAO dao ;
	
	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		dao = (ProductionOrderDAO) DAOFactory.getDAO(sessionFactory, ProductionOrderDAO.class);
	}

	public Page<ProductionOrder> listPagination(Page<ProductionOrder> page) throws CRUDException {
		return dao.pagination(page, "from ProductionOrder where deleteFlag = '0'", null);
	}

	public void save(ProductionOrder object) throws CRUDException {
		dao.save(object);
	}

	public ProductionOrder findById(String id) throws CRUDException {
		return dao.get(id);
	}

	public void update(ProductionOrder object) throws CRUDException {
		dao.update(object);
	}

}
